#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.65])
AC_INIT([rendersound], [0.9], [bugs@jamclouds.com])

AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(src/rendersound.c)

AM_INIT_AUTOMAKE([subdir-objects])
AM_PROG_CC_C_O

# Checks for programs.
#AC_PROG_CC

# Checks for libraries and header files.
# Checks for libraries and header files.

AC_CHECK_LIB(gd,gdImageCreateTrueColor,,AC_MSG_ERROR(Required library GD not found.))
AC_CHECK_HEADER(gd.h,,AC_MSG_ERROR(Headers for GD not found.))

#AC_CHECK_LIB(sndfile,sf_open,,AC_MSG_ERROR(Required library SNDFILE not found.))
#AC_CHECK_HEADER(sndfile.h,,AC_MSG_ERROR(Headers for SNDFILE not found.))

#AC_CHECK_LIB(mpg123,mpg123_init,,AC_MSG_ERROR(Required library MPG123 not found.))
#AC_CHECK_HEADER(mpg123.h,,AC_MSG_ERROR(Headers for MPG123 not found.))

#PKG_CHECK_MODULES(LIBMPG123,libmpg123)
#AC_SUBST(LIBMPG123_CFLAGS)
#AC_SUBST(LIBMPG123_LIBS)

PKG_CHECK_MODULES(LIBAVCODEC,libavcodec)
PKG_CHECK_MODULES(LIBAVFORMAT,libavformat)
PKG_CHECK_MODULES(LIBSWSCALE,libswscale)

# Enable debug traces.
AC_ARG_ENABLE(debug,
[  --enable-debug    Turn on debugging],
[case "${enableval}" in
  yes) debug=true ;;
  no)  debug=false ;;
  *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],[debug=false])
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL

AC_OUTPUT(Makefile)
